﻿
using ZR.Model.Models.ProductionControl;

namespace CKS.PLC.Core.Siemens
{
    public interface ISiemensClient
    {
        bool IsConnected { get; set; }

        int HeartValue {  get; set; }
        bool IsOnline { get; set; }
        PlcConfig PlcInfo { get; set; }

        Task ConnectPlc(CancellationToken cancellation);
        Task DoHeart();
        Task Execute(CancellationToken cancellation);
        Task ExecuteMain();
        void ExecuteSubscriptionAction(DecodeValue value);
       

        Task StartAsync(CancellationToken cancellation);
        Task<byte[]> ReadBytesAsync(int db, int startByteAdr, int count);
        short ReadInt16(int db, int startByteAdr);

        void WriteInt16(int db, int startByteAdr, Int16 value);
        void SetValue(CksPlcDataPosition s7Point, string configValue);

        object GetValue(CksPlcDataPosition s7Point);
    }
}